import {request, config} from 'utils'

const {api} = config
const {employees} = api

export function query (params) {
  return request({
    url: employees,
    method: 'get',
    data: params,
  })
}

export function batchDelete (params) {
  return request({
    url: employees + '/delete',
    method: 'post',
    data: params,
  })
}

export function leave (params) {
  return request({
    url: employees + '/leave',
    method: 'post',
    data: params,
  })
}

export function resetPassword (params) {
  return request({
    url: employees + '/password',
    method: 'patch',
    data: params,
  })
}

export function searchEmp ({key}) {
  return request({
    url: employees + '/keys/' + key,
    method: 'get',
  })
}

export function create (params) {
  return request({
    url: employees,
    method: 'post',
    data: params,
  })
}

export function remove (params) {
  return request({
    url: employees,
    method: 'delete',
    data: params,
  })
}

export function update (params) {
  return request({
    url: employees,
    method: 'put',
    data: params,
  })
}
